details about the number of users logged in.

Is it possible to check the number of user who are logged in to DOORS at a particular time using DXL script by any user who is not having the admin access.
SystemAdmin - Fri Oct 26 07:16:03 EDT 2012

Re: details about the number of users logged in.
Johnny_P - Mon Oct 29 08:15:34 EDT 2012

I don't think so. I used the following script to see who is connected to the database:

Skip skpUsers = createString()
Lock lckItem = null
LockList lockList = getLocksInDatabase(true)
string sCurrentUser = null
User uCurrentUser = null
string sUsername = null
string sResultText = null
string sThisUser = doorsname
int iUserCount = null
 
    for lckItem in lockList do {  
                sCurrentUser = lckItem.user
                put(skpUsers, sCurrentUser, sCurrentUser)   // ignores duplicates
        }
        
        for sCurrentUser in skpUsers do {  
                iUserCount++
                
                uCurrentUser = find(sCurrentUser)
                sUsername = uCurrentUser.name
 
                sResultText = sResultText "\n\t" sUsername
 
        }
        iUserCount++ // add the current user 
        sResultText = "\n\t" sThisUser sResultText // add the current user
        
        sResultText = "Usercount: "iUserCount"\n\nConnected users:" sResultText
 
        delete(skpUsers)
 
        DB dbTextBox = create("Currently connected users", styleStandard|styleCentered)
        DBE t1 = text(dbTextBox,"",sResultText, 320, 200, true)
        
        show dbTextBox

 


The problem is, that this code works with locks. If a user does not have any locks (e.g. he/she stays at the database item in the DOORS explorer) then the user will not be recognised.
Also this code only works if the user has the rights to see locks from all users. Otherwise only one user will be shown.

Regards,
Johnny

 

Re: details about the number of users logged in.
adevicq - Mon Oct 29 10:01:40 EDT 2012

Johnny_P - Mon Oct 29 08:15:34 EDT 2012

I don't think so. I used the following script to see who is connected to the database:

Skip skpUsers = createString()
Lock lckItem = null
LockList lockList = getLocksInDatabase(true)
string sCurrentUser = null
User uCurrentUser = null
string sUsername = null
string sResultText = null
string sThisUser = doorsname
int iUserCount = null
 
    for lckItem in lockList do {  
                sCurrentUser = lckItem.user
                put(skpUsers, sCurrentUser, sCurrentUser)   // ignores duplicates
        }
        
        for sCurrentUser in skpUsers do {  
                iUserCount++
                
                uCurrentUser = find(sCurrentUser)
                sUsername = uCurrentUser.name
 
                sResultText = sResultText "\n\t" sUsername
 
        }
        iUserCount++ // add the current user 
        sResultText = "\n\t" sThisUser sResultText // add the current user
        
        sResultText = "Usercount: "iUserCount"\n\nConnected users:" sResultText
 
        delete(skpUsers)
 
        DB dbTextBox = create("Currently connected users", styleStandard|styleCentered)
        DBE t1 = text(dbTextBox,"",sResultText, 320, 200, true)
        
        show dbTextBox

 


The problem is, that this code works with locks. If a user does not have any locks (e.g. he/she stays at the database item in the DOORS explorer) then the user will not be recognised.
Also this code only works if the user has the rights to see locks from all users. Otherwise only one user will be shown.

Regards,
Johnny

 

Thanks,
FYI i used the script without locking any module (open doors, run the script) and I see my name in the list..
Regards
Alain

Re: details about the number of users logged in.
llandale - Mon Oct 29 13:41:34 EDT 2012

adevicq - Mon Oct 29 10:01:40 EDT 2012
Thanks,
FYI i used the script without locking any module (open doors, run the script) and I see my name in the list..
Regards
Alain

If you are in a project or folder then you have that project/folder "locked"; someone else could not delete it.